// Importing new photos into Mission
// Copyright 2006 (C) Ralph Thomas

#ifndef MISSION_APPS_PHOTO_IMPORT_H
#define MISSION_APPS_PHOTO_IMPORT_H

#include <string>
#include <boost/filesystem/path.hpp>
#include <boost/function.hpp>

namespace apps {
	namespace photo {
		//
		/// Should the image be copied, moved or just referenced
		/// when importing it?
		//
		enum eImportType {
			kMove,		///< Move the image into the library.
			kCopy,		///< Copy the image into the library.
			kReference	///< Reference the image.
		};
		//
		/// Import a single image into the library.
		///
		/// \param	path	the path to the image.
		/// \param	target	the path to the photo library.
		/// \param	how	move, copy or ref. the image.
		/// \param	tag	the tag to apply to this image,
		///			empty string for none otherwise
		///			the tag id.
		/// \return	true if the image was imported correctly,
		///		false otherwise.
		//
		bool import_image( const boost::filesystem::path& path,
			const boost::filesystem::path& target,
			eImportType how, const std::string& tag );
		//
		/// Function to get called while importing multiple
		/// images.
		///
		/// \param	new_url		the new URL to the image in
		///				the library.
		/// \param	progress	percentage progress.
		//
		typedef boost::function<void (
			const std::string& new_url,
			double progress )> progress_func_t;
		//
		/// Import the contents of an entire directory. This
		/// function will call the given progress_func when
		/// it can report progress.
		///
		/// \param	path	the path to the directory.
		/// \param	how	move, copy or ref. the image.
		/// \param	tag	the tag to apply to the image.
		/// \param	progress	the progress function to call.
		//
		void import_directory( const boost::filesystem::path& path,
			const boost::filesystem::path& target,
			eImportType how, const std::string& tag, const
		        progress_func_t& progress );
	}
}

#endif

